package cn.iocoder.yudao.module.indicator.domain.entity;

import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description 指标信息实体类
 * @Author ZWC
 * @Date 2024/9/26 14:56
 */
@Data
@TableName("INDICATOR_DATA")
@Schema(description = "指标")
public class Indicator extends TenantBaseDO {

    @TableId(value = "ID")
    private Long id;

    @TableField("INDEX_NAME")
    @Schema(description = "指标名称")
    private String indexName;

    @TableField("INDEX_DESCRIBE")
    @Schema(description = "指标描述")
    private String indexDescribe;

    @TableField("INDEX_UNIT")
    @Schema(description = "指标单位")
    private String indexUnit;

    @TableField("INDICATOR_ORIENTATION")
    @Schema(description = "指标导向")
    private String indicatorOrientation;

    @TableField("CALCULATION_FORMULA")
    @Schema(description = "计算公式中文 为了前端回显： ['同期门诊诊疗总人次数', '/', '门诊使用基本药物人次数(不含溶媒)','='];\"\n")
    private String calculationFormula;

    @TableField("CALCULATION_FORMULA_ID")
    @Schema(description = "计算公式ID 指标计算公式ids ${1}/${2}")
    private String calculationFormulaId;

    @TableField("ELEMENT_IDS")
    @Schema(description = "元素ids 逗号分割")
    private String elementIds;

    @TableField("JSON_DATA")
    @Schema(description = "返回前端json串")
    private String  jsonData;

    @TableField("INDEX_ENABLE")
    @Schema(description = "是否启用")
    private String indexEnable;

    @TableField("ENABLE_TIME")
    @Schema(description = "启用时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date enableTime;


    @TableField("SOURCE_TYPE")
    @Schema(description = "指标数据资源分类")
    private String sourceType;

    @TableField(exist = false)
    private Map<Long, List<ElementData>> elementInfoMap;
}
